//
//  StockManagementPopCell.m
//  TryShopping
//
//  Created by LiYinDi on 16/6/22.
//  Copyright © 2016年 RuiBen. All rights reserved.
//

#import "StockManagementPopCell.h"

@implementation StockManagementPopCell

- (void)awakeFromNib {
    // Initialization code
    [self setAutoLayOut];
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}
-(void)setModel:(StockManagementPopListModel *)model
{
    _nameLabel.text=model.companyName;
    _stockLabel.textColor=qianheiColor;
    _nameLabel.textColor=shenhuiColor;
    _stockLabel.text=[NSString stringWithFormat:@"库存 %d",[model.specInv intValue]];
    NSMutableAttributedString *attriString = [[NSMutableAttributedString alloc] initWithString:[NSString stringWithFormat:@"库存 %d",[model.specInv intValue]]];
    [attriString addAttribute:NSForegroundColorAttributeName value:[UIColor colorWithRed:102/255.0 green:102/255.0 blue:102/255.0 alpha:1.0] range:NSMakeRange(0, 2)];
    _stockLabel.attributedText=attriString;
 
}
-(void)setAutoLayOut
{
    [_lineLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.mas_left).with.offset(10);
        make.right.equalTo(self.mas_right).with.offset(-10);
        make.height.equalTo(@0.5);
        make.bottom.equalTo(self.mas_bottom);
    }];
    [_nameLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.mas_left).with.offset(16);
        make.height.equalTo(@21);
        make.centerY.equalTo(self.mas_centerY);
        make.right.equalTo(_stockLabel.mas_left).with.priorityLow();
    }];
    [_stockLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.right.equalTo(self.mas_right).with.offset(-16).with.priorityHigh();
        make.height.equalTo(@21);
        make.centerY.equalTo(self.mas_centerY);
        make.left.equalTo(_nameLabel.mas_right).with.priorityLow();
    }];
}
@end
